3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
A mesh is a collection of vertices and faces that represent a topological polyhedron. The polyhedron does not need to be closed (that is, a mesh may have a boundary). The structure of a mesh is maintained privately by QuickDraw 3D, using the following structure types:
typedef struct TQ3MeshComponentPrivate *TQ3MeshComponent;
typedef struct TQ3MeshContourPrivate *TQ3MeshContour;
typedef struct TQ3MeshEdgeRepPrivate *TQ3MeshEdge;
typedef struct TQ3MeshVertexPrivate *TQ3MeshFace;
You create a new mesh by calling Q3Mesh_New . When first created, a mesh is empty--it contains no vertices, faces, or edges. These must be added by calling Q3Mesh_VertexNew and Q3Mesh_FaceNew .
Once a mesh has been created and populated with vertices and faces, you can access the data associated with it by using the following routines:
TQ3Status Q3Mesh_GetNumVertices
TQ3Status Q3Mesh_GetNumFaces
TQ3Status Q3Mesh_GetNumEdges
TQ3Status Q3Mesh_GetNumComponents
TQ3Status Q3Mesh_GetNumCorners
TQ3Status Q3Mesh_GetOrientable
Q3Mesh_GetOrientable returns the Boolean variable orientable , which is true only if the faces of a mesh can be consistently oriented. A tessellated Möbius strip and the surface of a Klein bottle are two classic examples of nonorientable meshes.
A mesh's attribute set can be accessed and set by the routines
TQ3Status Q3Geometry_GetAttributeSet
TQ3Status Q3Geometry_SetAttributeSet
In addition, each mesh vertex, face, edge, and corner of a mesh can have a set of attributes attached to it.
The routines you can use to create and alter meshes are described in "Creating and Editing Meshes" .
QuickDraw 3D supports meshes primarily for interactive rendering of polygonal models, not for representing large polygonal databases. A mesh is always a retained object, never an immediate object. As a result, QuickDraw 3D does not supply routines to draw or write meshes.
There is only one public data structure defined for meshes, the mesh iterator structure. You use the mesh iterator structure when you call any one of a large number of mesh iterators. The mesh iterator structure is defined by the TQ3MeshIterator data type.
typedef struct TQ3MeshIterator {
void *var1;
void *var2;
void *var3;
struct {
void *field1;
char field2[4];
} var4;
} TQ3MeshIterator;
Previous | QD3D Book | Overview | Chapter Contents | Next |